<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>从外部加载文件内容</title>
<style type="text/css">
   #logscontent{
	   font-size:12px;
   }
</style>

<script src="jquery/jquery-1.9.1.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
	  $("#btn1").click(function(){                      //按钮事件处理代码
		$('#logscontent').load('jquery/files/logs.txt');  //Ajax加载服务器端文件
	  })
	})
</script>
</head>
<body>
<h2>网站日志</h2>
<button id="btn1" type="button">获得外部的内容</button>
<!--用来放置服务器端文件的div元素-->
<div id="logscontent"></div>
</body>
</html>
